package com.cn.xiaonuo.slbfinances.stockcontrol.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cn.xiaonuo.slbfinances.stockcontrol.entity.SlOrderStream;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface SlOrderStreamMapper extends BaseMapper<SlOrderStream> {
    /**
     * 查询专卖店库存变动涉及商品及店铺
     * @param createTime
     * @return
     */
    List<Map<String, Object>> getStoreInvolved(@Param("createTime") String createTime);

    /**
     * 查询每日的最后一条作为当天的当前数量
     * @param shopId
     * @param createTime
     * @param type 1:专卖店 2:供应商
     * @return
     */
    SlOrderStream getLastUpdateData(@Param("shopId") Integer shopId, @Param("repoSpecId") Integer repoSpecId,@Param("createTime") String createTime,@Param("type") Integer type);

    /**
     * 出库总数
     * @param shopId
     * @param type 1:专卖店 2:供应商
     * @return
     */
    Map<String, Object> totalIssue(@Param("shopId") Integer shopId,@Param("createTime") String createTime,@Param("type") Integer type);

    /**
     * 入库总数
     * @param shopId
     * @param type 1:专卖店 2:供应商
     * @return
     */
    Map<String, Object> totalWarehousing(@Param("shopId") Integer shopId,@Param("createTime") String createTime,@Param("type") Integer type);

    /**
     * 查询供应商库存变动涉及商品及店铺
     * @param createTime
     * @return
     */
    List<Map<String, Object>> getSupplierStoreInvolved(@Param("createTime") String createTime);
}
